from django import forms
from .models import NewsComments

#使用django创建表单，包含用户注册和评论表单

class CreateUserForm(forms.Form):
    username = forms.CharField(max_length=20,
                               widget=forms.TextInput(attrs={'placeholder': 'Username', 'name': 'Username'}))
    password = forms.CharField(max_length=16,
                               widget=forms.PasswordInput(attrs={'placeholder': 'Password', 'name': 'Password'}))

class CommentsForm(forms.Form):
    comments = forms.CharField(max_length=2000, widget=forms.TextInput())